package vetAdmin.swing;

import java.awt.BorderLayout;
import java.awt.FlowLayout;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.plaf.basic.BasicInternalFrameTitlePane.CloseAction;
import javax.swing.JTextField;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JLabel;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.JComboBox;
import java.awt.TextArea;
import javax.swing.JTextArea;

public class HistoriaClinicaDialog extends JDialog {

	private final JPanel contentPanel = new JPanel();
	private JPanel buttonPane;
	private JTextField motivoField;
	private JTextField diagField;
	private JComboBox vetComboBox;
	private JLabel lblAtendidoPor;
	private JLabel lblMotivoDeLa;
	private JTextArea trataField;
	
	/**
	 * Create the dialog.
	 */
	public HistoriaClinicaDialog() {
		setResizable(false);
        initComponents();
		
	}
	
	public String getVeterinario() {
		return vetComboBox.getSelectedItem().toString();
	}
	
	public String getMotivo() {
		return motivoField.getText();
	}
	
	public String getDiagnostico() {
		return diagField.getText();
	}	
	
	public String getTratamiento() {
		return trataField.getText();
	}
	
	private void initComponents() {
		

		lblAtendidoPor = new JLabel("Atendido por:");
		
		vetComboBox = new JComboBox();
		
		lblMotivoDeLa = new JLabel("Motivo de la consulta: ");
		
		motivoField = new JTextField();
		
		diagField = new JTextField();
		
		trataField = new JTextArea();
		
		
		
		setTitle("Nueva Consulta");
		setBounds(100, 100, 450, 300);
		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
		{
			buttonPane = new JPanel();
			buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
			{
				JButton okButton = new JButton("Aceptar");
				okButton.setActionCommand("");
				buttonPane.add(okButton);
				getRootPane().setDefaultButton(okButton);
				
				okButton.addActionListener(new java.awt.event.ActionListener() {            
		        	
			        public void actionPerformed(java.awt.event.ActionEvent evt) {
			         
			        }
				
				
				
				});
			
			
			{
				JButton cancelButton = new JButton("Cancelar");
				cancelButton.setActionCommand("Cancel");
				buttonPane.add(cancelButton);
			}
		}
		GroupLayout groupLayout = new GroupLayout(getContentPane());
		groupLayout.setHorizontalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addComponent(contentPanel, GroupLayout.PREFERRED_SIZE, 434, GroupLayout.PREFERRED_SIZE)
				.addComponent(buttonPane, GroupLayout.PREFERRED_SIZE, 434, GroupLayout.PREFERRED_SIZE)
		);
		groupLayout.setVerticalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addComponent(contentPanel, GroupLayout.PREFERRED_SIZE, 229, GroupLayout.PREFERRED_SIZE)
					.addComponent(buttonPane, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
		);
		
		motivoField.setColumns(10);
		
		JLabel lblDiagnstico = new JLabel("Diagn\u00F3stico: ");
		
		
		diagField.setColumns(10);
		
		JLabel lblTratamiento = new JLabel("Tratamiento:");
		
		
		GroupLayout gl_contentPanel = new GroupLayout(contentPanel);
		gl_contentPanel.setHorizontalGroup(
			gl_contentPanel.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_contentPanel.createSequentialGroup()
					.addContainerGap()
					.addGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING)
						.addComponent(lblMotivoDeLa)
						.addComponent(lblDiagnstico)
						.addComponent(lblTratamiento)
						.addComponent(lblAtendidoPor))
					.addPreferredGap(ComponentPlacement.RELATED)
					.addGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING)
						.addComponent(vetComboBox, GroupLayout.PREFERRED_SIZE, 184, GroupLayout.PREFERRED_SIZE)
						.addComponent(trataField, GroupLayout.DEFAULT_SIZE, 292, Short.MAX_VALUE)
						.addComponent(diagField, GroupLayout.DEFAULT_SIZE, 292, Short.MAX_VALUE)
						.addComponent(motivoField, GroupLayout.DEFAULT_SIZE, 292, Short.MAX_VALUE))
					.addContainerGap())
		);
		gl_contentPanel.setVerticalGroup(
			gl_contentPanel.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_contentPanel.createSequentialGroup()
					.addGap(5)
					.addGroup(gl_contentPanel.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblAtendidoPor)
						.addComponent(vetComboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
					.addPreferredGap(ComponentPlacement.UNRELATED)
					.addGroup(gl_contentPanel.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblMotivoDeLa)
						.addComponent(motivoField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
					.addPreferredGap(ComponentPlacement.UNRELATED)
					.addGroup(gl_contentPanel.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblDiagnstico)
						.addComponent(diagField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
					.addGap(18)
					.addGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING)
						.addComponent(lblTratamiento)
						.addComponent(trataField, GroupLayout.DEFAULT_SIZE, 103, Short.MAX_VALUE))
					.addContainerGap())
		);
		contentPanel.setLayout(gl_contentPanel);
		getContentPane().setLayout(groupLayout);
		
		}
		
		
	}
	
	
	
/**
 * Launch the application.
 */
public static void main(String[] args) {
	try {
		HistoriaClinicaDialog dialog = new HistoriaClinicaDialog();
		dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
		dialog.setVisible(true);
	} catch (Exception e) {
		e.printStackTrace();
	}
} 
}
